import request from '@/config/axios'

// 奖金 VO
export interface RewardVO {
  id: number // 主键
  type: number // ENUM:账户类型,0-现金
  status: number // ENUM:状态,0-未到账,1-已到账,2-已取消
}

// 奖金 API
export const RewardApi = {
  // 查询奖金分页
  getRewardPage: async (params: any) => {
    return await request.get({ url: `/wo/reward/page`, params })
  },

  // 查询奖金详情
  getReward: async (id: number) => {
    return await request.get({ url: `/wo/reward/get?id=` + id })
  },

  // 新增奖金
  createReward: async (data: RewardVO) => {
    return await request.post({ url: `/wo/reward/create`, data })
  },

  // 修改奖金
  updateReward: async (data: RewardVO) => {
    return await request.put({ url: `/wo/reward/update`, data })
  },

  // 删除奖金
  deleteReward: async (id: number) => {
    return await request.delete({ url: `/wo/reward/delete?id=` + id })
  },

  // 导出奖金 Excel
  exportReward: async (params) => {
    return await request.download({ url: `/wo/reward/export-excel`, params })
  },
  exportProfit: async (params) => {
    return await request.download({ url: `/wo/reward/export-profit`, params })
  }
}
